/*
 * @Author: chen qi
 * @Date: 2022-07-07 16:56:45
 * @LastEditors: chen qi
 * @LastEditTime: 2022-07-07 17:15:38
 * @Description:
 */
import Vue from 'vue'
import VueRouter from 'vue-router'
Vue.use(VueRouter)
const routes = [
  {
    path: '/',
    name: 'home',
    component: () => import('@/views/home')
  },
  {
    path: '*',
    redirect: '/'
  }
]

const createRouter = () => new VueRouter({
  mode: 'hash', // history,hash 模式  hash模式兼容性高
  base: process.env.BASE_URL, // 基础路径
  scrollBehavior: () => ({ y: 0 }),
  routes // 路由集
})

const router = createRouter()

export default router
